import tkinter
from tkinter import ttk,font
win=tkinter.Tk()
win.title("测试")
win.geometry("300x200")
ls1 = list(font.families())
ls1.sort(reverse=False)
typeface = tkinter.StringVar()
typeface__combobox = ttk.Combobox(win,textvariable=typeface,width=30,state='readonly',font=('微软雅黑'))#创建下拉菜单
typeface__combobox["value"] = (ls1)#下拉选项
typeface__combobox.grid(row=0,column=0)
typeface__label = tkinter.Label(win,text="")
typeface__label.grid(row=1,column=0)
def Typeface(self):
    ls2 = typeface.get()
    ls2 = ls2.replace(' ','')
    print(ls2)
    typeface__combobox["font"] = ls2
    typeface__label["font"] = ls2
    typeface__label["text"] = typeface.get()

typeface__combobox.bind("<<ComboboxSelected>>",Typeface)#绑定事件
win.mainloop()
